package io.bufferedstream;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class Test2 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("AdvancedCode/src/io/nbufferedstream/test/info.txt"));
        // 一次读取一个字符
        /*int ch;
        while ((ch = br.read()) != -1){
            System.out.print((char)ch);
        }*/
        // 一次读取一个字符数组
        /*char[] chs = new char[1024];
        int count;
        while ((count = br.read(chs)) != -1){
            System.out.println(new String(chs, 0, count));
        }*/
        // 一次读取一行
        String str;
        while ((str = br.readLine()) != null){
            System.out.println(str);
        }

        br.close();
    }
}
